home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 February / CHIPCD_02_2002.iso / Internet / Macromedia ColdFusion Server 5 / coldfusion-50-win-us.exe / data1.cab / Examples / CFDOCS / snippets / parameterexists.cfm < prev    next >
Encoding:
Text File  |  2001-06-13  |  1.2 KB  |  54 lines

  1. <!--- This example shows ParameterExists --->
  2.  
  3. <HTML>
  4.  
  5. <HEAD>
  6. <TITLE>
  7. ParameterExists Example
  8. </TITLE>
  9. </HEAD>
  10.  
  11. <BASEFONT FACE="Arial, Helvetica" SIZE=2>
  12. <BODY  bgcolor="#FFFFD5">
  13.  
  14. <H3>ParameterExists Example</H3>
  15.  
  16. <CFIF ParameterExists(form.myString)>
  17. <P>Using ParameterExists, we have shown that the form
  18. field "myString" now exists.  However, this function is
  19. provided for backward compatibility with Cold Fusion 2.0 and
  20. the function IsDefined should be used instead, as below.
  21.  
  22.  
  23. </CFIF>
  24.  
  25. <CFIF IsDefined("form.myString")>
  26. <P>Because the variable form.myString has been defined, we
  27. can now show its contents.  This construction allows us
  28. to place a form and its resulting action template in the same
  29. template, while using IsDefined to control the
  30. flow of template execution.
  31. <P>The value of "form.myString" is <B><I><CFOUTPUT>#form.myString#</CFOUTPUT></I></B>
  32.  
  33. <CFELSE>
  34. <P>During the first time through this template, the variable
  35. "form.myString" has not yet been defined, so we 
  36. are not attempting to evaluate it.
  37. </CFIF>
  38.  
  39.  
  40. <FORM ACTION="parameterexists.cfm" METHOD="POST">
  41.  
  42. <INPUT TYPE="Text" NAME="MyString" VALUE="My sample value">
  43.  
  44.  
  45. <INPUT TYPE="Submit" NAME="">
  46.  
  47. </FORM>
  48.  
  49. </BODY>
  50.  
  51. </HTML>       
  52.     
  53.    
  54.